home *** CD-ROM | disk | FTP | other *** search
- Path: dd.chalmers.se!news.chalmers.se!sunic!EU.net!news.eunet.fi!prime.mdata.fi!mits!rkaivola
- From: rkaivola@mits.mdata.fi (Risto Kaivola)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Removing Task started with CreateNewProc
- Date: 12 Apr 1994 10:46:39 +0200
- Organization: MITS - Helsinki - Finland
- Lines: 34
- Message-ID: <rkaivola.766139627@mits>
- References: <rknopCo3z57.Azo@netcom.com>
- NNTP-Posting-Host: mits.mdata.fi
-
- rknop@netcom.com (Robert Knop) writes:
-
- >[weird crashes when a parent task is attempting to remove a child
- > task in Wait(0L)]
-
- >(1) Is RemTask what you are supposed to use to delete AmiagDOS processes, just
- >as you do Exec Tasks? I couldn't find another function that seemed more
- >appropriate for getting rid of the task. (The entry in the AmigaDOS manual
- >about CreateNewProc certainly didn't mention anything, but that entry looks
- >like it was written by somebody either in a hurry to get it finished, or who
- >didn't like typing a whole lot.)
-
- I'm not sure exactly what is wrong with your code or the operating
- system or the documentation, but I think the following is typically
- done when a child task wants to remove itself:
- Forbid();
- RemTask(NULL);
-
- The advantage here is that if the child task is executing code
- for which the memory was allocated by someone else, this guarantees
- that when the allocator of the memory frees the memory, it won't
- pull the carpet from under the child.
-
- >(2) Is my code that I discuss here likely OK, meaning that I am getting a
- >weird problem with something else that corrupts memory or some such?
-
- This is just a guess, but it may be that the OS does strange things
- when a task executing some critical pieces of code is removed.
-
- >-Rob Knop
-
- --
- Risto Kaivola
- (Internet address: rkaivola@mits.mdata.fi)
-